package com.ourteam.system.dao.impl;

import com.ourteam.system.dao.ISysUserDAO;
import com.ourteam.system.dao.SysUser;
import com.ourteam.system.dao.SysUserDAOQueryBean;

import net.dao.AbstractSpringDAO;
import net.dao.DataAccessObjectHelper;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/**
 * Template Name : DAO服务对象
 * Template Version : 1
 * Template Last Modfiy Date : Fri Nov 17 11:00:11 CST 2017
 * Auto Generate Date : 2018-07-31 15:13:35
  * Warning ! This file will be overwrite when regenerate !
  *
 */
public class AbstractSysUserDAOJdbcImpl extends AbstractSpringDAO
    implements ISysUserDAO {
    public static final String[] ENTITY_FIELDS = new String[] {
            Id, Remarks, Status, UserAccount, UserName, UserType, Password,
            LastLoginTime, UserMail, UserCode, UserPhoto, UserMobilePhone,
            UserOfficePhone, UserDepartment, UserRole, UserDepartmentRole,
            ModifyTime, OperatorId, UserStatus, CreateTime, SeatCode,
            SeatPassword, WechatOpenId, OperatorName
        };
    public static final String[] ENTITY_PROPERTIES = new String[] {
            _DataObjectProperty.Id, _DataObjectProperty.Remarks,
            _DataObjectProperty.Status, _DataObjectProperty.UserAccount,
            _DataObjectProperty.UserName, _DataObjectProperty.UserType,
            _DataObjectProperty.Password, _DataObjectProperty.LastLoginTime,
            _DataObjectProperty.UserMail, _DataObjectProperty.UserCode,
            _DataObjectProperty.UserPhoto, _DataObjectProperty.UserMobilePhone,
            _DataObjectProperty.UserOfficePhone,
            _DataObjectProperty.UserDepartment, _DataObjectProperty.UserRole,
            _DataObjectProperty.UserDepartmentRole,
            _DataObjectProperty.ModifyTime, _DataObjectProperty.OperatorId,
            _DataObjectProperty.UserStatus, _DataObjectProperty.CreateTime,
            _DataObjectProperty.SeatCode, _DataObjectProperty.SeatPassword,
            _DataObjectProperty.WechatOpenId, _DataObjectProperty.OperatorName
        };
    public static final String[] ENTITY_PK_FIELDS = new String[] { Id };
    public static final String[] ENTITY_AUTO_GEN_PK_FIELDS = new String[] { Id };
    public static final String[] ENTITY_UNIQUE_FIELDS = new String[] { UserAccount };
    private static String relatedJoinSQL = null;
    private static String basicFilterSQL = null;
    private DataAccessObjectHelper<SysUser, SysUserDAOQueryBean> daoHelper;
    private com.ourteam.system.dao.impl.AbstractSysUserRoleRelateDAOJdbcImpl SysUserRoleRelateDao;

    public AbstractSysUserDAOJdbcImpl() {
        super();
        daoHelper = new DataAccessObjectHelper<SysUser, SysUserDAOQueryBean>(this);
    }

    protected String getEntityName() {
        return EntityName;
    }

    protected String[] getEntityFields() {
        return ENTITY_FIELDS;
    }

    protected String[] getEntityProperties() {
        return ENTITY_PROPERTIES;
    }

    protected String[] getEntityPKFields() {
        return ENTITY_PK_FIELDS;
    }

    protected String[] getEntityAutoGenPKFields() {
        return ENTITY_AUTO_GEN_PK_FIELDS;
    }

    protected String[] getEntityUniqueFields() {
        return ENTITY_UNIQUE_FIELDS;
    }

    protected String getBaiscQueryFilter() {
        if (basicFilterSQL == null) {
            StringBuffer basicFilterSQLbuffer = new StringBuffer();

            basicFilterSQL = basicFilterSQLbuffer.toString();
        }

        return basicFilterSQL;
    }

    protected String getRelatedJoinSQL() {
        if (relatedJoinSQL == null) {
            StringBuffer relatedJoinSQLBuffer = new StringBuffer();

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.system.dao.ISysUserDAO.EntityName)
                                .append(" operator_user ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.system.dao.ISysUserDAO.Id,
                    com.ourteam.system.dao.ISysUserDAO.EntityName + ".",
                    "operator_user."));
            relatedJoinSQLBuffer.append(" = ").append(OperatorId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQL = relatedJoinSQLBuffer.toString();
        }

        return relatedJoinSQL;
    }

    /**
         * Check Data Unique
         * @param aSysUser
         * @throws Exception
         */
    public boolean checkIsUnique(SysUser aSysUser) throws Exception {
        if (aSysUser == null) {
            return true;
        }

        List valueList = new ArrayList();

        List pkValueList = new ArrayList();

        pkValueList.add(aSysUser.getId());

        valueList.add(aSysUser.getUserAccount());

        return isUnique(valueList.toArray(new Object[valueList.size()]),
            pkValueList.toArray(new Object[pkValueList.size()]));
    }

    /**
     * Insert Data
     * @param aSysUser
     * @throws Exception
     */
    public void insert(SysUser aSysUser) throws Exception {
        super.doInsert(aSysUser);
    }

    /**
         * Batch Insert Datas
         * @param aSysUser
         * @throws Exception
         */
    public void batchInsert(SysUser[] aSysUsers) throws Exception {
        super.doBatchInsert(aSysUsers);
    }

    /**
         * Delete Data
         * @param  final long id         *
         * @throws Exception
         */
    public void delete(final long id) throws Exception {
        super.doDeleteById(new Object[] { new Long(id) });
    }

    /**
     * Delete Datas
     * @param queryBean
     * @throws Exception
     */
    public void delete(SysUserDAOQueryBean queryBean) throws Exception {
        super.doDeleteByQuery(queryBean);
    }

    public void delete(SysUser aSysUser) throws Exception {
        delete(aSysUser.getId());
    }

    /**
     * Update Data Selective
     * @param aSysUser
     * @throws Exception
     */
    public void update(SysUser aSysUser) throws Exception {
        if (aSysUser.getId() == 0) {
            throw new Exception(
                "Can not update object data whith out primary key value");
        }

        super.doUpdate(aSysUser);

        SysUser tempObj = findById(aSysUser.getId());

        if (tempObj != null) {
            PropertyUtils.copyProperties(aSysUser, tempObj);
        }
    }

    /**
     * Batch Update Datas
     * @param aSysUsers[]
     * @throws Exception
     */
    public void batchUpdate(SysUser[] aSysUsers) throws Exception {
        super.doBatchUpdate(aSysUsers);
    }

    /**
         * Update Data By Condictions
         * @param aSysUser
         * @param aValueCriteria
         * @param aTransaction
         * @throws Exception
         */
    public void update(SysUser aSysUser, SysUserDAOQueryBean aQueryBean)
        throws Exception {
        super.doUpdateByQuery(aSysUser, aQueryBean);
    }

    /**
     * Update Data By Condictions
     * @param aQueryBean
     * @throws Exception
     */
    public void update(SysUserDAOQueryBean aQueryBean)
        throws Exception {
        super.doUpdateByQuery(aQueryBean);
    }

    protected void checkNullValue(SysUser aSysUser) throws Exception {
        if (aSysUser.getSeatCode() == null) {
            throw new Exception("The SysUser.seatCode value is not allow NULL");
        }

        if (aSysUser.getSeatPassword() == null) {
            throw new Exception(
                "The SysUser.seatPassword value is not allow NULL");
        }

        if (aSysUser.getLastLoginTime() == null) {
            throw new Exception(
                "The SysUser.lastLoginTime value is not allow NULL");
        }

        if (aSysUser.getUserOfficePhone() == null) {
            throw new Exception(
                "The SysUser.userOfficePhone value is not allow NULL");
        }

        if (aSysUser.getUserStatus() == null) {
            throw new Exception(
                "The SysUser.userStatus value is not allow NULL");
        }

        if (aSysUser.getUserDepartment() == null) {
            throw new Exception(
                "The SysUser.userDepartment value is not allow NULL");
        }

        if (aSysUser.getCreateTime() == null) {
            throw new Exception(
                "The SysUser.createTime value is not allow NULL");
        }

        if (aSysUser.getUserRole() == null) {
            throw new Exception("The SysUser.userRole value is not allow NULL");
        }

        if (aSysUser.getUserMail() == null) {
            throw new Exception("The SysUser.userMail value is not allow NULL");
        }

        if (aSysUser.getUserDepartmentRole() == null) {
            throw new Exception(
                "The SysUser.userDepartmentRole value is not allow NULL");
        }

        if (aSysUser.getUserMobilePhone() == null) {
            throw new Exception(
                "The SysUser.userMobilePhone value is not allow NULL");
        }

        if (aSysUser.getModifyTime() == null) {
            throw new Exception(
                "The SysUser.modifyTime value is not allow NULL");
        }

        if (aSysUser.getOperatorName() == null) {
            throw new Exception(
                "The SysUser.operatorName value is not allow NULL");
        }

        if (aSysUser.getUserCode() == null) {
            throw new Exception("The SysUser.userCode value is not allow NULL");
        }

        if (aSysUser.getUserPhoto() == null) {
            throw new Exception("The SysUser.userPhoto value is not allow NULL");
        }

        if (aSysUser.getRemarks() == null) {
            throw new Exception("The SysUser.remarks value is not allow NULL");
        }

        if (aSysUser.getStatus() == null) {
            throw new Exception("The SysUser.status value is not allow NULL");
        }

        if (aSysUser.getUserName() == null) {
            throw new Exception("The SysUser.userName value is not allow NULL");
        }

        if (aSysUser.getUserType() == null) {
            throw new Exception("The SysUser.userType value is not allow NULL");
        }
    }

    /**
     * Get Data By ID
     * @param  final long id         * @return  ${businessObject.name}
     * @throws Exception
     */
    public SysUser findById(final long id) throws Exception {
        SysUserDAOQueryBean queryBean = new SysUserDAOQueryBean();

        SysUserDAOQueryBean.Criteria criteria = queryBean.createCriteria();

        criteria.andIdEqualTo(id);

        //queryBean.setDistinct(true);
        SysUser[] SysUsers = query(queryBean);

        if (SysUsers.length == 0) {
            return null;
        } else {
            return SysUsers[0];
        }
    }

    /**
         * Query Data
         * @param queryBean
         * @return SysUser[]
         * @throws Exception
         */
    public SysUser[] query(SysUserDAOQueryBean queryBean)
        throws Exception {
        List result = super.doQuery(queryBean, new JdbcSysUserRowMapper());

        return (SysUser[]) result.toArray(new SysUser[result.size()]);
    }

    /**
     * Query ${businessObject.name} Selective
     * @param queryBean
     * @return Map[]
     * @model
     * @throws Exception
     */
    public Map<String, Object>[] querySelective(SysUserDAOQueryBean queryBean)
        throws Exception {
        if (queryBean.getSelectProperties().isEmpty()) {
            queryBean.addAllSelectProperties();
        }

        return super.doQuerySelective(queryBean);
    }

    /**
     * Query Data Count
     * @param queryBean
     * @return int
     * @throws Exception
     */
    public int queryCount(SysUserDAOQueryBean queryBean)
        throws Exception {
        return super.doQueryCount(queryBean);
    }

    public void synchronize(SysUser[] aSysUsers, SysUserDAOQueryBean queryBean)
        throws Exception {
        daoHelper.synchronize(aSysUsers, queryBean);
    }

    public void synchronize(SysUser[] aSysUsers, SysUserDAOQueryBean queryBean,
        net.dao.IDataAccessInterface.ISynchronizeCallback<SysUser> callBack)
        throws Exception {
        daoHelper.synchronize(aSysUsers, queryBean, callBack);
    }

    public void setSysUserRoleRelateDao(
        com.ourteam.system.dao.ISysUserRoleRelateDAO SysUserRoleRelateDao) {
        this.SysUserRoleRelateDao = (com.ourteam.system.dao.impl.AbstractSysUserRoleRelateDAOJdbcImpl) SysUserRoleRelateDao;
    }

    /**
     * Query Related SysUserRoleRelate
    * @param queryBean
     * @throws Exception
     */
    public com.ourteam.system.dao.SysUserRoleRelate[] querySysUserRoleRelate(
        SysUserDAOQueryBean queryBean) throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysUserRoleRelateDAO.UserId)
               .append(" = ").append(Id);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysUserRoleRelateDAO.EntityName +
            " ref_SysUserRoleRelate";

        String[] entityFields = com.ourteam.system.dao.impl.SysUserRoleRelateDAO.ENTITY_FIELDS;

        String[] entityProperties = com.ourteam.system.dao.impl.SysUserRoleRelateDAO.ENTITY_PROPERTIES;

        List list = SysUserRoleRelateDao.doQuery(entityName, entityFields,
                entityProperties, queryBean, joinSQL.toString(),
                new com.ourteam.system.dao.impl.SysUserRoleRelateDAO.JdbcSysUserRoleRelateRowMapper());

        return (com.ourteam.system.dao.SysUserRoleRelate[]) list.toArray(new com.ourteam.system.dao.SysUserRoleRelate[list.size()]);
    }

    /**
     * Query Related SysUserRoleRelate Selective
     * @param queryBean
     * @return Map[]
     * @model
     * @throws Exception
     */
    public Map<String, Object>[] querySysUserRoleRelateSelective(
        SysUserDAOQueryBean queryBean) throws Exception {
        if (queryBean.getSelectProperties().isEmpty()) {
            queryBean.addSelectProperty(com.ourteam.system.dao.ISysUserRoleRelateDAO.Id,
                "id");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysUserRoleRelateDAO.ExpiredDate,
                "expiredDate");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysUserRoleRelateDAO.Remarks,
                "remarks");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysUserRoleRelateDAO.RoleId,
                "roleId");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysUserRoleRelateDAO.Status,
                "status");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysUserRoleRelateDAO.UserId,
                "userId");
        }

        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysUserRoleRelateDAO.UserId)
               .append(" = ").append(Id);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysUserRoleRelateDAO.EntityName +
            " ref_SysUserRoleRelate";

        return SysUserRoleRelateDao.doQuerySelective(entityName, queryBean,
            joinSQL.toString());
    }

    /**
     * Update Related SysUserRoleRelate
     * @param aSysUserRoleRelate
     * @param aQueryBean
     * @model
     * @throws Exception
     */
    public void updateSysUserRoleRelate(
        com.ourteam.system.dao.SysUserRoleRelate aSysUserRoleRelate,
        SysUserDAOQueryBean aQueryBean) throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysUserRoleRelateDAO.UserId)
               .append(" = ").append(Id);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysUserRoleRelateDAO.EntityName +
            " ref_SysUserRoleRelate";

        String[] entityFields = com.ourteam.system.dao.impl.SysUserRoleRelateDAO.ENTITY_FIELDS;

        String[] entityProperties = com.ourteam.system.dao.impl.SysUserRoleRelateDAO.ENTITY_PROPERTIES;

        SysUserRoleRelateDao.doUpdateByQuery(entityName, entityFields,
            entityProperties, joinSQL.toString(), aSysUserRoleRelate, aQueryBean);
    }

    /**
     * Delete Related SysUserRoleRelate
     * @param aQueryBean
     * @model
     * @throws Exception
     */
    public void deleteSysUserRoleRelate(SysUserDAOQueryBean aQueryBean)
        throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysUserRoleRelateDAO.UserId)
               .append(" = ").append(Id);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysUserRoleRelateDAO.EntityName; // + " ref_SysUserRoleRelate";

        SysUserRoleRelateDao.doDeleteByQuery(entityName, joinSQL.toString(),
            aQueryBean);
    }

    public static class JdbcSysUserRowMapper implements RowMapper<SysUser> {
        public SysUser mapRow(ResultSet resultSet, int arg1)
            throws SQLException {
            SysUser object = new SysUser();

            int columnIndex = 1;

            int __dataType;

            try {
                Object id = null;

                id = resultSet.getObject(columnIndex++);

                object.setIdNull(resultSet.getBoolean(columnIndex++));

                if (id != null) {
                    setBeanValue(object, _DataObjectProperty.Id, id);
                }

                Object remarks = null;

                remarks = resultSet.getObject(columnIndex++);

                object.setRemarksNull(resultSet.getBoolean(columnIndex++));

                if (remarks != null) {
                    setBeanValue(object, _DataObjectProperty.Remarks, remarks);
                }

                Object status = null;

                status = resultSet.getObject(columnIndex++);

                object.setStatusNull(resultSet.getBoolean(columnIndex++));

                if (status != null) {
                    setBeanValue(object, _DataObjectProperty.Status, status);
                }

                Object userAccount = null;

                userAccount = resultSet.getObject(columnIndex++);

                object.setUserAccountNull(resultSet.getBoolean(columnIndex++));

                if (userAccount != null) {
                    setBeanValue(object, _DataObjectProperty.UserAccount,
                        userAccount);
                }

                Object userName = null;

                userName = resultSet.getObject(columnIndex++);

                object.setUserNameNull(resultSet.getBoolean(columnIndex++));

                if (userName != null) {
                    setBeanValue(object, _DataObjectProperty.UserName, userName);
                }

                Object userType = null;

                userType = resultSet.getObject(columnIndex++);

                object.setUserTypeNull(resultSet.getBoolean(columnIndex++));

                if (userType != null) {
                    setBeanValue(object, _DataObjectProperty.UserType, userType);
                }

                Object password = null;

                password = resultSet.getObject(columnIndex++);

                object.setPasswordNull(resultSet.getBoolean(columnIndex++));

                if (password != null) {
                    setBeanValue(object, _DataObjectProperty.Password, password);
                }

                Object lastLoginTime = null;

                __dataType = resultSet.getMetaData().getColumnType(columnIndex);

                if ((__dataType == java.sql.Types.DATE) ||
                        (__dataType == java.sql.Types.TIME) ||
                        (__dataType == java.sql.Types.TIMESTAMP)) {
                    lastLoginTime = resultSet.getTimestamp(columnIndex++);
                } else {
                    lastLoginTime = resultSet.getObject(columnIndex++);
                }

                object.setLastLoginTimeNull(resultSet.getBoolean(columnIndex++));

                if (lastLoginTime != null) {
                    setBeanValue(object, _DataObjectProperty.LastLoginTime,
                        lastLoginTime);
                }

                Object userMail = null;

                userMail = resultSet.getObject(columnIndex++);

                object.setUserMailNull(resultSet.getBoolean(columnIndex++));

                if (userMail != null) {
                    setBeanValue(object, _DataObjectProperty.UserMail, userMail);
                }

                Object userCode = null;

                userCode = resultSet.getObject(columnIndex++);

                object.setUserCodeNull(resultSet.getBoolean(columnIndex++));

                if (userCode != null) {
                    setBeanValue(object, _DataObjectProperty.UserCode, userCode);
                }

                Object userPhoto = null;

                userPhoto = resultSet.getObject(columnIndex++);

                object.setUserPhotoNull(resultSet.getBoolean(columnIndex++));

                if (userPhoto != null) {
                    setBeanValue(object, _DataObjectProperty.UserPhoto,
                        userPhoto);
                }

                Object userMobilePhone = null;

                userMobilePhone = resultSet.getObject(columnIndex++);

                object.setUserMobilePhoneNull(resultSet.getBoolean(
                        columnIndex++));

                if (userMobilePhone != null) {
                    setBeanValue(object, _DataObjectProperty.UserMobilePhone,
                        userMobilePhone);
                }

                Object userOfficePhone = null;

                userOfficePhone = resultSet.getObject(columnIndex++);

                object.setUserOfficePhoneNull(resultSet.getBoolean(
                        columnIndex++));

                if (userOfficePhone != null) {
                    setBeanValue(object, _DataObjectProperty.UserOfficePhone,
                        userOfficePhone);
                }

                Object userDepartment = null;

                userDepartment = resultSet.getObject(columnIndex++);

                object.setUserDepartmentNull(resultSet.getBoolean(columnIndex++));

                if (userDepartment != null) {
                    setBeanValue(object, _DataObjectProperty.UserDepartment,
                        userDepartment);
                }

                Object userRole = null;

                userRole = resultSet.getObject(columnIndex++);

                object.setUserRoleNull(resultSet.getBoolean(columnIndex++));

                if (userRole != null) {
                    setBeanValue(object, _DataObjectProperty.UserRole, userRole);
                }

                Object userDepartmentRole = null;

                userDepartmentRole = resultSet.getObject(columnIndex++);

                object.setUserDepartmentRoleNull(resultSet.getBoolean(
                        columnIndex++));

                if (userDepartmentRole != null) {
                    setBeanValue(object,
                        _DataObjectProperty.UserDepartmentRole,
                        userDepartmentRole);
                }

                Object modifyTime = null;

                __dataType = resultSet.getMetaData().getColumnType(columnIndex);

                if ((__dataType == java.sql.Types.DATE) ||
                        (__dataType == java.sql.Types.TIME) ||
                        (__dataType == java.sql.Types.TIMESTAMP)) {
                    modifyTime = resultSet.getTimestamp(columnIndex++);
                } else {
                    modifyTime = resultSet.getObject(columnIndex++);
                }

                object.setModifyTimeNull(resultSet.getBoolean(columnIndex++));

                if (modifyTime != null) {
                    setBeanValue(object, _DataObjectProperty.ModifyTime,
                        modifyTime);
                }

                Object operatorId = null;

                operatorId = resultSet.getObject(columnIndex++);

                object.setOperatorIdNull(resultSet.getBoolean(columnIndex++));

                if (operatorId != null) {
                    setBeanValue(object, _DataObjectProperty.OperatorId,
                        operatorId);
                }

                Object userStatus = null;

                userStatus = resultSet.getObject(columnIndex++);

                object.setUserStatusNull(resultSet.getBoolean(columnIndex++));

                if (userStatus != null) {
                    setBeanValue(object, _DataObjectProperty.UserStatus,
                        userStatus);
                }

                Object createTime = null;

                __dataType = resultSet.getMetaData().getColumnType(columnIndex);

                if ((__dataType == java.sql.Types.DATE) ||
                        (__dataType == java.sql.Types.TIME) ||
                        (__dataType == java.sql.Types.TIMESTAMP)) {
                    createTime = resultSet.getTimestamp(columnIndex++);
                } else {
                    createTime = resultSet.getObject(columnIndex++);
                }

                object.setCreateTimeNull(resultSet.getBoolean(columnIndex++));

                if (createTime != null) {
                    setBeanValue(object, _DataObjectProperty.CreateTime,
                        createTime);
                }

                Object seatCode = null;

                seatCode = resultSet.getObject(columnIndex++);

                object.setSeatCodeNull(resultSet.getBoolean(columnIndex++));

                if (seatCode != null) {
                    setBeanValue(object, _DataObjectProperty.SeatCode, seatCode);
                }

                Object seatPassword = null;

                seatPassword = resultSet.getObject(columnIndex++);

                object.setSeatPasswordNull(resultSet.getBoolean(columnIndex++));

                if (seatPassword != null) {
                    setBeanValue(object, _DataObjectProperty.SeatPassword,
                        seatPassword);
                }

                Object wechatOpenId = null;

                wechatOpenId = resultSet.getObject(columnIndex++);

                object.setWechatOpenIdNull(resultSet.getBoolean(columnIndex++));

                if (wechatOpenId != null) {
                    setBeanValue(object, _DataObjectProperty.WechatOpenId,
                        wechatOpenId);
                }

                Object operatorName = null;

                operatorName = resultSet.getObject(columnIndex++);

                object.setOperatorNameNull(resultSet.getBoolean(columnIndex++));

                if (operatorName != null) {
                    setBeanValue(object, _DataObjectProperty.OperatorName,
                        operatorName);
                }

                return object;
            } catch (Exception e) {
                throw new SQLException(e.getMessage());
            }
        }
    }
}
